package com.example.commons.exception;

public class DuplicateUsernameException extends RuntimeException {
    // 添加注释
    private String attemptedUsername;

    public DuplicateUsernameException(String attemptedUsername) {
        super("Username '" + attemptedUsername + "' already exists.");
        this.attemptedUsername = attemptedUsername;
    }

    public DuplicateUsernameException(String attemptedUsername, Throwable cause) {
        super("Username '" + attemptedUsername + "' already exists.", cause);
        this.attemptedUsername = attemptedUsername;
    }

    public String getAttemptedUsername() {
        return attemptedUsername;
    }
}